home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
LowerBoundedHeap.cc,v
< prev
next >
Wrap
Text File
|
1989-03-28
|
2KB
|
98 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @@;
3.2
date 89.02.20.15.35.59; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.48.59; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#include "LowerBoundedHeap.h"
#include "CpuMultiplexor.h"
#include "stream.h"
#include "assert.h"
LowerBoundedHeap::LowerBoundedHeap(int defaultLength)
: (defaultLength), lowerBoundLock(0)
{
//
// do nothing
//
}
void LowerBoundedHeap::add(AwesimeHeapItem &t) {
LockedHeap::add(t);
lowerBoundLock.release();
}
bool
LowerBoundedHeap::remove(AwesimeHeapItem &item) {
(void) lowerBoundLock.reserve();
bool ok = LockedHeap::remove(item);
//
// The remove had better have worked, or there's something screwy
// with the semaphores.
//
assert(ok);
return(ok);
}
bool
LowerBoundedHeap::doDelete(AwesimeHeapIndex& )
{
assert(0);
return(0);
}
unsigned int
LowerBoundedHeap::size()
{
return(AwesimeHeap::size());
}
void LowerBoundedHeap::classPrintOn(ostream& s)
{
s << "[LowerBoundedHeap " ;
s << "\tSemaphore\n";
s << lowerBoundLock;
s << "\n";
s << "\tHeap";
AwesimeHeap::classPrintOn(s);
s << "\n]\n" ;
}
@
3.1
log
@Steay version
@
text
@@